home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7796 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  51 lines

  1. Path: iway.fr!usenet
  2. From: Pascal Terracol <assetsto@pratique.fr>
  3. Newsgroups: comp.lang.c
  4. Subject: Pointer arithmetic
  5. Date: 29 Feb 1996 00:14:28 GMT
  6. Organization: AssetsToMediA
  7. Message-ID: <4h2r55$er@s3.iway.fr>
  8. NNTP-Posting-Host: ts7-p24.dialup.iway.fr
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
  13. X-URL: news:comp.lang.c/168868-168967
  14.  
  15.  Hello,
  16.  
  17. this sample code have been correctly working on a pc 80286 processor
  18.  
  19. I put it on a mac and the pointers seems to act differently...
  20. any idea about that ? 
  21.  
  22.  
  23.      int size, n1, n2 ;
  24.      Point  *p_debut, *p1, *p2 ;                      /* "vecteur" de translation des adr  */
  25.  
  26. ...
  27.  
  28.       n1 = (int) (l->p1)/sizeof(Point) ;
  29.          n2 = (int) (l->p2)/sizeof(Point) ;
  30.         
  31.             p1 = p_debut + n1 ;
  32.             p2 = p_debut + n1 ;
  33. ...
  34.  
  35. is there a cast solution ?
  36. this is the "Point" structure 
  37.  
  38. typedef struct  {   float x, y, z ;                /*   coordonnes point 3d       */
  39.                                    float tx, ty, tz ;             /*   coord. transformee 3d      */
  40.                        float px, py, pz ;             /*   coord. pixels fenetre2d */
  41.                        int ix, iy  ;                  /*   coord. pixels 2d ecran  */
  42.                        int   compute ;                /*   point calcule ? 1 oui      */
  43.                 }   Point ;
  44.  
  45.  
  46. Bonjour de Paris,
  47.  
  48. Pascal
  49.  
  50.  
  51.